 {block name="body"}
<link rel="shortcut icon" href="favicon.ico">
<link href="__CSS__/bootstrap.min.css" rel="stylesheet">
<link href="__CSS__/font-awesome.min.css" rel="stylesheet">
<link href="__CSS__/animate.min.css" rel="stylesheet">
<link href="__CSS__/style.min.css" rel="stylesheet">
<link href="__CSS__/admin.css" rel="stylesheet">
<div class="ibox float-e-margins">
	<div class="ibox-content">
		<form method="post" action="{:url('members')}">
			<div class="form-group" >
				会员卡号&nbsp;&nbsp;<input type="text" id="member_no" name="member_no"   class="bank" />
				手机号码 <input type="text" id="mobile" name="mobile"  class="bank" />
				会员姓名 <input type="text" id="membername" name="membername"  class="bank" />
				性别 <select class="bank" name="sex"><option value="">全部</option><option value="1">男</option><option value="2">女</option></select>
			</div>
			<div class="form-group">
				会员生日&nbsp;&nbsp;<input style="width: 185px;"  name='m1'  onclick="WdatePicker({dateFmt:'MM-dd',readOnly:true})"  type='text'  class="bank layer-date" />--
					<input style="width: 185px;"  name='m2'  onclick="WdatePicker({dateFmt:'MM-dd',readOnly:true})"  type='text'  class="bank layer-date" />
				创建时间<input style="width: 185px;"  name='c1'  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})"  type='text'  class="bank layer-date" />--
				<input style="width: 185px;"  name='c2'  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})"  type='text'  class="bank layer-date" />
				<span class="bank"><button type="submit" class="btn btn-info btn-primary"><li class="fa fa-search"> 查询</li></button> </span>
				<span class="bank"><button type="button" class="btn btn-info btn-primary btn-save"><li class="fa fa-save"> 确定</li></button> </span>
			</div>
		</form>
		<div class="example-wrap">
			<div class="example">				
					<table class="table table-bordered table-hover" style="margin-bottom:1px;">
						<thead>
							<tr class="long-th">
								<th width="3%">
									<input type="checkbox" name="check" id="check" class="check-all">
								</th>
								<th width="15%">会员编号</th>
								<th width="15%">姓名</th>
								<th width="15%">手机号码</th>
								<th width="15%">生日</th>
								<th width="18%">创建时间</th>
								<th width="15%">累计消费(￥)</th>
							</tr>
						</thead>
						</table>
						<div style="overflow-y: scroll;height:450px;">
						<table class="table table-bordered table-hover">
						<tbody>
							{foreach name="list" item="ad"}
							<tr class="long-th">
								<td class="text-center" width="3%">
									<input type="checkbox" name="ids[]" value="{$ad.id}" data-mobile="{$ad.mobile}"> 
								</td>
								<td width="15%" class="text-center">{$ad.member_no}</td>
								<td width="15%" class="text-center">{$ad.membername}</td>
								<td width="15%" class="text-center">{$ad.mobile}</td>
								<td width="15%" class="text-center">{$ad.birthday_monthday}</td>
								<td width="18%" class="text-center">{$ad.reg_date}</td>
								<td width="15%" class="text-center">
									{$ad.total_cost}
								</td>
							</tr>
							{/foreach}
						</tbody>
							</table>
						</div>
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.metisMenu.js"></script>
<script src="__JS__/jquery.slimscroll.min.js"></script>
<script src="__LIB__/layer/layer.js"></script>
<script src="__JS__/core.min.js"></script>
<script src="__JS__/pace.min.js"></script>
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__LIB__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__LIB__/ueditor/ueditor.all.js" type="text/javascript"></script>
<script>
	function wclose(){
    	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
        parent.layer.close(index);  
	}
</script>
<script>
	$("#check").click(function(){
        if(this.checked){
            $("input[name='ids[]']").each(function(){this.checked=true})
        }else{
            $("input[name='ids[]']").each(function(){this.checked=false})
        }
    });
    
    $(".btn-save").click(function(){
		var hasChk = $('input[name="ids[]"]:checked').is(':checked');
		if(!hasChk){
			layer.msg("请选择会员!");
			return false;
		}
		var obj=$("#mobile",parent.document);
		$('input[name="ids[]"]:checked').each(function(){ 
			var mobile=$(this).attr("data-mobile");
			obj.html(obj.html()+"\n"+mobile);
		}); 
        parent.layer.closeAll();  
		
//		var idstr=id_array.join(',');//将数组元素连接起来以构建一个字符串  
    });
</script>
<style>
.bank{
	width: 150px;
    height:30px;
    text-align:center;
    border-radius:5px;
}
</style>
{/block}